package com.lyy.override_;


/**
 * @Author:  GZQ
 * @date:  2024/11/17 16:27
 * @description: 2. 编写一个Student类，继承Person类，增加id、 score属性/private, 以及构造器，方法：say(返回自我介绍字符串)
 */

public class Student extends Person{

    private int id;
    private double score;

    public Student(String name, int age, int id, double score) {
        // 这里自动调用父类构造器
        super(name, age);
        this.id = id;
        this.score = score;
    }

    public String say(){
        return super.say()+" "+" id是"+id+" " + " 考了"+score;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }
}
